package com.sjmsks.Jpanels.work.shape;

import java.awt.*;
import java.awt.geom.Ellipse2D;

// 自定义的圆形控件
public class Circle extends AbstractShape {

	@Override
	public void draw(Graphics2D g2d) {
		g2d.setPaint(getColor());
		g2d.setStroke(getStroke());
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.drawOval(Math.min(x1, x2), Math.min(y1, y2), Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)),
				Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)));
	}

	@Override
	public Color getColor() {
		return super.getColor();
	}

	@Override
	public void setColor(Color color) {
		super.setColor(color);
	}

	@Override
	public Stroke getStroke() {
		return super.getStroke();
	}

	@Override
	public void setStroke(Stroke stroke) {
		super.setStroke(stroke);
	}


}
